#pragma once

//------------------------------------------------------------------------
//
//  Name:				CGEEvent.h
//
//  Desc:				A class deal with Event
//
//  Author:				Crane Shen
//
//  CGE:				Crane's Game Engine
//
//  Create Time:		4/26 2010
//
// 
// Add new enum for you need.
//------------------------------------------------------------------------




#include "SDL.h"


/** Event enumerations */
enum CGEEventType
{
	//SDL_NOEVENT = 0,			/**< Unused (do not remove) */
	//SDL_ACTIVEEVENT,			/**< Application loses/gains visibility */
	CGE_KEYDOWN = SDL_KEYDOWN,			/**< Keys pressed */
	CGE_KEYUP = SDL_KEYUP,			/**< Keys released */
	CGE_MOUSEMOTION = SDL_MOUSEMOTION,			/**< Mouse moved */
	CGE_MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN,		/**< Mouse button pressed */
	CGE_MOUSEBUTTONUP = SDL_MOUSEBUTTONUP,		/**< Mouse button released */
	//SDL_JOYAXISMOTION,		/**< Joystick axis motion */
	//SDL_JOYBALLMOTION,		/**< Joystick trackball motion */
	//SDL_JOYHATMOTION,		/**< Joystick hat position change */
	//SDL_JOYBUTTONDOWN,		/**< Joystick button pressed */
	//SDL_JOYBUTTONUP,			/**< Joystick button released */
	CGE_QUIT = SDL_QUIT,			/**< User-requested quit */
	//SDL_SYSWMEVENT,			/**< System specific event */
	//SDL_EVENT_RESERVEDA,		/**< Reserved for future use.. */
	//SDL_EVENT_RESERVEDB,		/**< Reserved for future use.. */
	//SDL_VIDEORESIZE,			/**< User resized video mode */
	//SDL_VIDEOEXPOSE,			/**< Screen needs to be redrawn */
	//SDL_EVENT_RESERVED2,		/**< Reserved for future use.. */
	//SDL_EVENT_RESERVED3,		/**< Reserved for future use.. */
	//SDL_EVENT_RESERVED4,		/**< Reserved for future use.. */
	//SDL_EVENT_RESERVED5,		/**< Reserved for future use.. */
	//SDL_EVENT_RESERVED6,		/**< Reserved for future use.. */
	//SDL_EVENT_RESERVED7,		/**< Reserved for future use.. */
	///** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
	//SDL_USEREVENT = 24,
	///** This last event is only for bounding internal arrays
	//*  It is the number of bits in the event mask datatype -- Uint32
	//*/
	//SDL_NUMEVENTS = 32
} ;


enum CGEKey
{
	CGEK_RETURN = SDLK_RETURN,
	CGEK_SPACE = SDLK_SPACE,
	CGEK_UP =  SDLK_UP,			
	CGEK_DOWN = SDLK_DOWN,		
	CGEK_RIGHT = SDLK_RIGHT,	
	CGEK_LEFT = SDLK_LEFT,
	
};
//mouse button sth.
enum CGEMouseButton
{
	CGEMB_LEFT = SDL_BUTTON_LEFT,
	CGEMB_MIDDLE = SDL_BUTTON_MIDDLE,
	CGEMB_RIGHT = SDL_BUTTON_RIGHT,
	CGEMB_WHEELUP = SDL_BUTTON_WHEELUP,
	CGEMB_WHEELDOWN = SDL_BUTTON_WHEELDOWN,
};

class CGEEvent
{
public:
	CGEEvent(void);
	virtual ~CGEEvent(void);

	bool				PollEvent();

	CGEEventType		GetEventType();
	CGEKey				GetKey();
	CGEMouseButton		GetMouseButton();
	void				GetMousePos(int *x, int *y);

	unsigned char* 				GetKeyState();//crane:Not every Input System has this,not necessarily,just for SDL
private:
	CGEEvent(const CGEEvent &fnt);
	CGEEvent&	operator= (const CGEEvent &fnt);

	SDL_Event   m_Event;
};
